<template>
	<view style="--view-theme: #905EFF; --view-assist: #FDA900; --view-priceColor: #FDA900; --view-bgColor: rgba(253, 169, 0,.1); --view-minorColor: rgba(144, 94, 255,.1); --view-bntColor11: #FFC552; --view-bntColor12: #FDB000; --view-bntColor21: #905EFF; --view-bntColor22: #A764FF;">
		<view class="acea-row nav">
			<view class="acea-row row-center-wrapper" :class="{ on: tabCur == 1 }" @click="tab(1)">全部</view>
			<view class="acea-row row-center-wrapper" :class="{ on: tabCur == 2 }" @click="tab(2)">未完成</view>
			<view class="acea-row row-center-wrapper" :class="{ on: tabCur == 3 }" @click="tab(3)">已完成</view>
		</view>
		
	   <!--标题和返回-->
		<!-- <cu-custom :bgColor="NavBarColor" isBack>
			<block slot="backText">返回</block>
			<block slot="content">APP更新</block>
		</cu-custom> -->
		<!--滚动加载列表-->
		<mescroll-body ref="mescrollRef" bottom="88"  @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
		    <block v-if="tabCur == 1">
				<view v-if="list && list.length" class="list">
					<view v-for="(item,index) in list" :key="index" class="item">
						<view class="acea-row item-hd">
							<view class="acea-row row-middle">
								<view class="name">{{ item.description }}</view>
								<view v-if="item.createBy" class="label">默认</view>
							</view>
							<!-- <view class="type" :class="item.receipt_type == 1 ? '' : 'special'">{{ item.receipt_type == 1 ? '普通发票' : '专用发票' }}</view> -->
						</view>
						<view class="item-bd">
							<view v-if="item.receipt_title_type == 1" class="cell">邮箱 {{ item.email }}</view>
							<view v-else>
								<view class="cell">时间 {{ item.createTime }}</view>
								<view class="cell">联系方式 {{ item.contacts }} {{ item.telephone }}</view>
								<view class="cell">上门地址 {{ item.homeAddress }}</view>
								
								<my-region label="开始时间："  placeholder="请选择开始时间" required fields="minute"></my-region>
								
								<view class="cell">工单号 {{ item.id }}{{range}}</view>
							</view>
						</view>
						<view class="acea-row row-right item-ft">
							<view class="btn" @tap="editInvoice(item.user_receipt_id)"><text class="iconfont icon-bianji"></text>编辑</view>
							<view class="btn" @tap="deleteInvoice(item.user_receipt_id,index)"><text class="iconfont icon-shanchu"></text>删除</view>
						</view>
					</view>
				</view>
			<!-- <view class="cu-list menu">
				<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
					<view class="flex" style="width:100%">
                        <text class="text-lg" style="color: #000;">
                             {{ item.createBy}}
                        </text>
					</view>
				</view>
			</view> -->
			</block>
		</mescroll-body>
	</view>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import Mixin from "@/common/mixin/Mixin.js";
	import myRegion from '@/components/my-componets/my-region.vue'

	export default {
		name: 'APP更新',
		mixins: [MescrollMixin,Mixin],
		components:{
		    myRegion
		 },
		data() {
			return {
				CustomBar:this.CustomBar,
				NavBarColor:this.NavBarColor,
				url: "/work/workOrder/list",
				tabCur:1,
			};
		},
		// computed: mapGetters(['isLogin','viewColor']),
		methods: {
			goHome(){
                this.$Router.push({name: "index"})
			},
			// 切换发票
			tab(type) {
				if (this.tabCur !== type) {
					this.tabCur = type;
					uni.setStorageSync('user_invoice_list',type)
					// if(type == 2){
					// 	this.getInvoiceList();
					// }else{
					// 	this.receiptOrder();
					// }
					
				}
			},
		}
	}
</script>
<style lang="scss" scoped>
	.nav {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9;
		width: 100%;
		height: 90rpx;
		background-color: #FFFFFF;
	}
	.nav .acea-row {
		flex: 1;
		border-top: 3rpx solid transparent;
		border-bottom: 3rpx solid transparent;
		font-size: 30rpx;
		color: #282828;
	}
	.nav .on {
		border-bottom-color: var(--view-theme);
		color: var(--view-theme);
	}
	.list {
		padding: 14rpx 32rpx;
		margin-top: 90rpx;
		padding-bottom: 220rpx;
	}
	.list .item {
		padding: 28rpx 32rpx;
		background-color: #FFFFFF;
	}
	.list .item~.item {
		margin-top: 14rpx;
	}
	.list .item-hd .acea-row {
		flex: 1;
		min-width: 0;
	}
	.list .name {
		font-weight: 600;
		font-size: 30rpx;
		color: #282828;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		max-width: 400rpx;
	}
	.list .label {
		width: 70rpx;
		height: 28rpx;
		border: 1rpx solid var(--view-theme);
		margin-left: 18rpx;
		font-size: 20rpx;
		line-height: 26rpx;
		text-align: center;
		color: var(--view-theme);
	}
	.list .type {
		width: 124rpx;
		height: 42rpx;
		background-color: #FCF0E0;
		font-size: 24rpx;
		line-height: 42rpx;
		text-align: center;
		color: #D67300;
	}
	.list .type.special {
		background-color: var(--view-minorColor);
		color: var(--view-theme);
	}
	.list .item-bd {
		margin-top: 18rpx;
	}
	.list .cell {
		font-size: 26rpx;
		color: #666666;
	}
	.list .cell~.cell {
		margin-top: 12rpx;
	}
	.list .item-ft {
		margin-top: 11rpx;
	}
	.list .btn {
		font-size: 26rpx;
		color: #282828;
		cursor: pointer;
	}
	.list .btn~.btn {
		margin-left: 35rpx;
	}
	.list .btn .iconfont {
		margin-right: 10rpx;
		font-size: 24rpx;
		color: #000000;
	}
	.add-btn {
		position: fixed;
		right: 30rpx;
		bottom: 20rpx;
		left: 30rpx;
		z-index: 9;
		height: 86rpx;
		border-radius: 43rpx;
		background-color: var(--view-theme);
		font-size: 30rpx;
		line-height: 86rpx;
		color: #FFFFFF;
	}
	.nothing {
		margin-top: 200rpx;
		text-align: center;		
	}
	.nothing_text{
		margin-top: 20rpx;
		color: #999999;
	}
	.store-list{
		margin-top: 110rpx;
		padding: 0 30rpx 30rpx;
		.item{
			padding: 30rpx;
			margin-bottom: 20rpx;
			background: #fff;
			border-radius: 6rpx;
			.hd{
				display: flex;
				image{
					width: 78rpx;
					height: 78rpx;
				}
				.name{
					flex:1;
					margin-left: 24rpx;
					line-height: 1.8;
					font-size: 26rpx;
					color: #282828;
				}
			}
			.bd{
				position: relative;
				padding: 25rpx 36rpx;
				margin-top: 36rpx;
				background: #F5F6F7;
				border-radius: 20rpx;
				.title{
					font-size: 26rpx;
					color: #282828;
					font-weight: bold;
				}
				.time{
					margin-top: 8rpx;
					font-size: 26rpx;
					color: #818181;
				}
				.price{
					position: absolute;
					right: 30rpx;
					top: 50%;
					transform: translateY(-50%);
					color: #282828;
					font-size: 32rpx;
					font-weight: bold;
					text{
						font-weight: normal;
						font-size: 24rpx;
					}
				}
			}
			.ft{
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 39rpx;
				text{
					color: #282828;
					font-size: 28rpx;
					font-weight: bold;
				}
				.btn{
					display: flex;
					align-items: center;
					justify-content: center;
					width: 150rpx;
					height: 57rpx;
					background: #FFFFFF;
					border: 1px solid #707070;
					border-radius: 29rpx;
					font-size: 26rpx;
				}
			}
		}
	}
</style>
